
<?php

//version SANS PAGINATOR , pour rappel + voir setEscape et setEncoding 

include_once 'autoload.php';

//modele 

$db = new Zend_Db_Adapter_Pdo_Mysql(array(
    'host ' => 'localhost',
    'username' => 'root',
    'password' => '',
    'dbname' => 'gsb'
        ));

$lesVisiteurs = new Zend_Db_Select($db);
$lesVisiteurs->from('visiteur');

$view = new Zend_View();
$view->addScriptPath('.');
$view->setEscape('htmlentities'); //nb tester l'affichage des accents 
$view->setEncoding('ISO-8859-1'); // sans ces 2 reglages 
//assignation a la vue et rendu explicite 

$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($lesVisiteurs));
$paginator->setItemCountPerPage(5);
$currentPage = isset($_GET['page']) ? (int) htmlentities($_GET['page']) : 1;
$paginator->setCurrentPageNumber($currentPage);

$view->paginator = $paginator;
echo $view->render('paginatorView02.php');
?>

